import Foundation

public struct MonthModel: Identifiable, Equatable {
    public var id = UUID()
    
    public var days: [DayModel] = []
    public var month: Int = 1
    public var year: Int = 2023
    
    public var date: Date {
        Calendar.gregorian.date(from: DateComponents(year: year, month: month)) ?? Date()
    }
    
    public static func == (lhs: MonthModel, rhs: MonthModel) -> Bool {
        lhs.id == rhs.id
    }
    
    public init(days: [DayModel] = [], month: Int = 1, year: Int = 2023) {
        self.id = UUID()
        self.days = days
        self.month = month
        self.year = year
    }
}
